#ifndef SPL_DRAWING
#define SPL_DRAWING

#define POINT_COUNT_ARROW     7
#define POINT_COUNT_TRIANGLE  3

enum ImageSizeMode
{
  //! Center image
  ImageSizeModeCenter   = 0,
  //! Repeat image
  ImageSizeModeTile     = 1,
  //! Image size fit screen size
  ImageSizeModeStretch  = 2,
  //! Image largest side fit screen size
  ImageSizeModeFit      = 6,
  //! Image smallest side fit screen size
  ImageSizeModeFill     = 10,
};

enum Orientation
{
  OrientationHorizontal = 0,
  OrientationVertical,
};

enum Direction
{
  DirectionUp = 1,
  DirectionLeft,
  DirectionDown,
  DirectionRight,
  DirectionFirst = DirectionUp,
  DirectionLast = DirectionRight,
};

SPLINL Gdip::Rect rectToInt(
  const Gdip::RectF& iValue
  )
{
  return Gdip::Rect(
    (INT)iValue.X,
    (INT)iValue.Y,
    (INT)iValue.Width,
    (INT)iValue.Height);
}

SPLINL Gdip::RectF rectToFloat(
  const Gdip::Rect& iValue
  )
{
  return Gdip::RectF(
    (Gdip::REAL)iValue.X,
    (Gdip::REAL)iValue.Y,
    (Gdip::REAL)iValue.Width,
    (Gdip::REAL)iValue.Height);
}

DLLEXPORT void drawImage(
  Gdip::Graphics*     g,
  const Gdip::Rect    &bounds,
  Gdip::Image*        image,
  ImageSizeMode       sizeMode
  );

DLLEXPORT void getRoundedRect(
  Gdip::GraphicsPath  &path,
  const Gdip::RectF   &bounds,
  Gdip::REAL          roundness
  );

DLLEXPORT void getRoundedRect(
  Gdip::GraphicsPath  &path,
  const Gdip::Rect    &bounds,
  INT                 roundness
  );

DLLEXPORT void getHalfRoundedRect(
  Gdip::GraphicsPath  &path,
  const Gdip::RectF   &bounds,
  Gdip::REAL          roundness
  );

DLLEXPORT void getHalfRoundedRect(
  Gdip::GraphicsPath  &path,
  const Gdip::Rect    &bounds,
  INT                 roundness
  );

DLLEXPORT VOID GetUpArrow(
  Gdip::PointF      (&oPoints)[POINT_COUNT_ARROW],
  const Gdip::RectF &iBounds
  );
DLLEXPORT VOID GetLeftArrow(
  Gdip::PointF      (&oPoints)[POINT_COUNT_ARROW],
  const Gdip::RectF &iBounds
  );
DLLEXPORT VOID GetDownArrow(
  Gdip::PointF      (&oPoints)[POINT_COUNT_ARROW],
  const Gdip::RectF &iBounds
  );
DLLEXPORT VOID GetRightArrow(
  Gdip::PointF      (&oPoints)[POINT_COUNT_ARROW],
  const Gdip::RectF &iBounds
  );

SPLINL VOID GetArrow(
  Gdip::PointF      (&oPoints)[POINT_COUNT_ARROW],
  const Gdip::RectF &iBounds,
  Direction         iDirection
  )
{
  switch (iDirection)
  {
  case DirectionUp:
    GetUpArrow(oPoints, iBounds);
    break;
  case DirectionLeft:
    GetLeftArrow(oPoints, iBounds);
    break;
  case DirectionDown:
    GetDownArrow(oPoints, iBounds);
    break;
  case DirectionRight:
    GetRightArrow(oPoints, iBounds);
    break;
  }
}

DLLEXPORT VOID GetUpTriangle(
  Gdip::PointF      (&oPoints)[POINT_COUNT_TRIANGLE],
  const Gdip::RectF &iBounds
  );
DLLEXPORT VOID GetDownTriangle(
  Gdip::PointF      (&oPoints)[POINT_COUNT_TRIANGLE],
  const Gdip::RectF &iBounds
  );
DLLEXPORT VOID GetLeftTriangle(
  Gdip::PointF      (&oPoints)[POINT_COUNT_TRIANGLE],
  const Gdip::RectF &iBounds
  );
DLLEXPORT VOID GetRightTriangle(
  Gdip::PointF      (&oPoints)[POINT_COUNT_TRIANGLE],
  const Gdip::RectF &iBounds
  );

#endif